package com.iceberg;

import java.util.ArrayList;

public class Main {

    public static void main(String[] args) {
	// write your code here
        System.out.println("Pride and Prejudice");
        ArrayList<String> words = new ArrayList<>();
        if (FileOperation.readFile("pride-and-prejudice.txt", words)){

            long start = System.nanoTime();
            Trie trie = new Trie();
            for (String word: words) {
              trie.insert(word);
            }
            for (String word: words){
                trie.search(word);
            }
            long end = System.nanoTime();
            double time = (end - start) / (1000*1000*1000.0);
            System.out.println(time);
        }
    }
}
